package cn.crism.springboot2_mybatis_demo.util;

import cn.crism.springboot2_mybatis_demo.vo.ResultVO;

public class ResultVOUtil {
    public static ResultVO SUCCESS(Object object) {
        ResultVO resultVO = new ResultVO();
        resultVO.setData(object);
        resultVO.setMsg("成功");
        resultVO.setCode(0);
        return resultVO;
    }

    public static ResultVO SUCCESS() {
        return SUCCESS(null);
    }

    public static ResultVO ERROR(Integer code, String msg) {
        ResultVO resultVO = new ResultVO();
        resultVO.setCode(code);
        resultVO.setMsg(msg);
        return resultVO;
    }
}
